package com.woniu.command.customerCommand;

import com.woniu.command.Command;
import com.woniu.command.handler.CustomerCommandHandler;
import com.woniu.utils.ApplicationContextHolder;

public class DeleteCustomerCommand implements Command<Long,Integer> {

    private CustomerCommandHandler handler;
    public DeleteCustomerCommand(){
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(CustomerCommandHandler.class);
    }
    @Override
    public Integer  execute(Long id) {
        return handler.deleteCustomerById(id);
    }
}
